package com.xxxx.web.entity;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xxxx.web.dto.*;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.apache.commons.beanutils.BeanUtils;

import java.lang.reflect.InvocationTargetException;

/**
 * 库位表表
 */
@Data
@TableName("`WarehouseBin`")
public class WarehouseBin extends BaseEntity {


    /**
     * 层
     */
    @JsonProperty("Level")
    @TableField(value = "Level", updateStrategy = FieldStrategy.IGNORED)
    private String Level;

    /**
     * 所属仓库
     */
    @JsonProperty("WarehouseId")
    @TableField(value = "WarehouseId", updateStrategy = FieldStrategy.IGNORED)
    private Integer WarehouseId;

    /**
     * 类型
     */
    @JsonProperty("Type")
    @TableField(value = "Type", updateStrategy = FieldStrategy.IGNORED)
    private String Type;

    /**
     * 库位编码
     */
    @JsonProperty("BinCode")
    @TableField(value = "BinCode", updateStrategy = FieldStrategy.IGNORED)
    private String BinCode;

    /**
     * 把库位表实体转换成库位表传输模型
     */
    public WarehouseBinDto MapToDto() throws InvocationTargetException, IllegalAccessException {
        WarehouseBinDto WarehouseBinDto = new WarehouseBinDto();

        BeanUtils.copyProperties(WarehouseBinDto, this);

        return WarehouseBinDto;
    }

}
